package com.zbkj.crmeb.merchant.admin.controller;


import com.common.CommonPage;
import com.crmeb.core.common.CommonResult;
import com.zbkj.crmeb.user.request.MemberRecordRequest;
import com.zbkj.crmeb.user.response.MemberRecordResponse;
import com.zbkj.crmeb.user.service.UserMemberRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 用户购买会员记录表 前端控制器
 * </p>
 *
 * @author wuzp
 * @since 2022-05-11
 */
@RestController
@RequestMapping("api/admin/mer/user/member")
@Api(tags = "用户 -- 会员")
public class MerUserMemberRecordController extends AdminBaseController {

    @Autowired
    private UserMemberRecordService userMemberRecordService;

    @ApiOperation(value = "会员分页列表")
    @GetMapping(value = "/list")
    public CommonResult<CommonPage<MemberRecordResponse>> getMerMemberList(MemberRecordRequest request, HttpServletRequest servletRequest){
        return CommonResult.success(CommonPage.restPage(userMemberRecordService.getMerMemberList(request, getMerId(servletRequest))));
    }

}

